UXarray logo

Customization & Interactivity

In this tutorial, you’ll learn about:

  • Customizing plots, including changing renders and setting parameters

  • Using Bokeh’s interactive functionality


Setup

import cartopy.crs as ccrs
import holoviews as hv
import uxarray as ux
from IPython.display import Image
grid_path = "../../meshfiles/oQU480.grid.nc"
data_path = "../../meshfiles/oQU480.data.nc"

uxds = ux.open_dataset(grid_path, data_path)

Customization

Selecting a Renderer

hv.extension("bokeh")
uxds["bottomDepth"].plot()
uxds["bottomDepth"].plot()
hv.extension("matplotlib")
uxds["bottomDepth"].plot()

Setting Default Parameters

hv.extension("bokeh")
hv.opts.defaults(hv.opts.Polygons(width=600, title="My Default Title", height=300))

Interactivity

hv.extension("bokeh")
# uxds['bottomDepth'].plot()

bokeh

# uxds['bottomDepth'].plot(dynamic=True)

dynamic